<template>
  <ConvertLayout :standard="standard" :initial="initial" :selectOptionsList="selectOptionsList" />
</template>

<script setup lang="ts">
import ConvertLayout from "../layout/ConvertLayout.vue";

// 光强换算的标准
const standard = {
  label: "千克(kg)",
  value: 1,
};
// 光强换算的初始值
const initial = {
  label: "克(g)",
  value: 1000,
};

// 进制换算的数值类型
const selectOptionsList: ConvertOptionsType = [
  {
    type: "group",
    label: "公制",
    key: "公制",
    children: [
      {
        label: "千克(kg)",
        value: "千克(kg)",
        num: 1,
        disabled: false,
      },
      {
        label: "克(g)",
        value: "克(g)",
        num: 1000,
        disabled: false,
      },
      {
        label: "毫克(mg)",
        value: "毫克(mg)",
        num: 1000000,
        disabled: false,
      },
      {
        label: "微克(μg)",
        value: "微克(μg)",
        num: 1e9,
        disabled: false,
      },
      {
        label: "吨(t)",
        value: "吨(t)",
        num: 0.001,
        disabled: false,
      },
      {
        label: "公担(q)",
        value: "公担(q)",
        num: 0.01,
        disabled: false,
      },
      {
        label: "公斤(kg)",
        value: "公斤(kg)",
        num: 1,
        disabled: false,
      },
    ],
  },
  {
    type: "group",
    label: "英制",
    key: "英制",
    children: [
      {
        label: "磅(lb)",
        value: "磅(lb)",
        num: 2.2,
        disabled: false,
      },
      {
        label: "盎司(oz)",
        value: "盎司(oz)",
        num: 35.27,
        disabled: false,
      },
      {
        label: "克拉(ct)",
        value: "克拉(ct)",
        num: 5000,
        disabled: false,
      },
      {
        label: "格令(gr)",
        value: "格令(gr)",
        num: 15432.36,
        disabled: false,
      },
      {
        label: "英石(st)",
        value: "英石(st)",
        num: 0.157,
        disabled: false,
      },
      {
        label: "打兰(dr)",
        value: "打兰(dr)",
        num: 564.38,
        disabled: false,
      },
    ],
  },
  {
    type: "group",
    label: "市制",
    key: "市制",
    children: [
      {
        label: "担",
        value: "担",
        num: 0.02,
        disabled: false,
      },
      {
        label: "斤",
        value: "斤",
        num: 2,
        disabled: false,
      },
      {
        label: "两",
        value: "两",
        num: 20,
        disabled: false,
      },
      {
        label: "钱",
        value: "钱",
        num: 200,
        disabled: false,
      },
      {
        label: "分",
        value: "分",
        num: 500000,
        disabled: false,
      },
    ],
  },
];
</script>
